package com.lei2j.dubbo.producer.service.impl;

import com.lei2j.dubbo.pojo.ValidateParams;
import com.lei2j.dubbo.service.ValidateService;
import org.apache.dubbo.config.annotation.Service;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * author: 98611
 * date: 2019/7/7
 */

@Service()
public class ValidateServiceImpl implements ValidateService {

    @Override
    public ValidateParams save(ValidateParams validateParams) {
        System.out.println("save()开始调用:"+validateParams);
        return validateParams;
    }

    @Override
    public ValidateParams update(ValidateParams validateParams) {
        System.out.println("update()开始调用:"+validateParams);
        return validateParams;
    }

    @Override
    public ValidateParams validateObject(@NotNull ValidateParams validateParams) {
        System.out.println("直接验证参数:"+validateParams);
        return validateParams;
    }

    @Override
    public void validateParam(@Min(10) int len) {
        System.out.println("min:"+len);
    }
}
